<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script src="${pageContext.request.contextPath}/JS/jquery3.3.1.js"></script>
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/bootstrap-theme.min.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/JS/bootstrap.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/JS/jquery-1.11.0.min.js"></script>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <link href="${pageContext.request.contextPath }/css/flowersingle.css" rel="stylesheet" type="text/css" />
<title>Insert title here</title>
<style type="text/css">
div{
float:left;
}
</style>
</head>
<body>
<%@ include file="/com/top.jsp" %>
<%@ include file="/com/top1.jsp" %>

<!-- 总开始 -->
<div id = "sell_order_zon" class = "" style = "min-width: 1347px;">
<!-- 左开始 -->
<div id = "" class = "" style = "">
	<%@ include file="/com/left.jsp" %>
</div><!-- 左结束 -->
	

<!-- 中心开始	 -->
<div id = "" class = "" style = "width:1000px;height:800px;margin-left: 3px;">


<!-- 标题开始 -->
	<div id = "" class = "font_color" style = "width: 100%;height:60px;font-weight: bold;
	text-align: center;background-color: #2e2e2e;">
		<div id = "" class = "" style = "width:100%;">卖家订单</div>
		<div id = "" class = "" style = "height:30px;margin-left: 45%;">
			<div id = "" class = "cycle" style = "width:30px;height:30px;">
				<img alt=""  src="${pageContext.request.contextPath}${shop.shophead}">
			</div>
			<div id = "" class = "" style = "height:30px;line-height: 30px;margin-left: 10px;font-size:12px;font-weight:bold;color:#ff3535">
				${shop.shopname }
			</div>
		</div>
	</div><!-- 标题结束 -->
	<div id = "" class = "font_color" style = "width:100%;text-align: right;">
	<a href= "#" onclick="" class = "font_color" style = "">
	<input type = "button" id = "" class = "btn btn-default btn-sm font_color" name = "" 
	style = "font-weight: bold;" value = "发货" onclick="fahuo()">
<!-- 	<button type="button" class="btn btn-default btn-xs">发货</button> -->
	</a></div>
	
<!-- 	表格开始 -->
	<div id = "" class = "" style = "">
		<table class = "table table-hover table-bordered" id = "sell_order_table">
		  <tr class = "warning">
		  	<th>
			  	全选
			  	<input type = "checkbox" id = "all_select" onchange="select_all(this)" class = "" name = "">
		  	</th>
		    <th>图片</th>
		    <th>商品名</th>
		    <th>单价</th>
		    <th>数量</th>
		    <th>用户</th>
		    <th>状态</th>
		  </tr>
		  <c:forEach items="${orders }" var = "n">
		  	<tr class = "active">
		  	<td style = "width:120px;">
		  		<c:if test="${n.status =='未发货' }">
			  		<input type = "checkbox" id = "" class = "sell_order_checkbox" name = "${n.orderid }" >
		  		</c:if>
		  	</td>
		    <td>
		    	<div id = "" class = "" style = "width:80px;height:80px;">
		    		<img alt="" src="${pageContext.request.contextPath}${n.img}" style = "width:100%;height:100%;">
		    	</div>
		    </td>
		    <td style = "min-width:150px;">
		    	${n.cmdyname }
		    </td>
		    <td style = "min-width:150px;font-weight: bold;font-size: 20px;" class = "font_color">
		    	${n.price }￥
		    </td>
		    <td style = "min-width:150px;">
		    	${n.ordernum }
		    </td>
		    <td style = "min-width:150px;">
		    	${n.username }
		    </td>
		    <td style = "width:150px;">
		    	${n.status }
		    </td>
		  </tr>
		  </c:forEach>
		</table>

	
	</div><!-- 	表格结束 -->




	

</div><!-- 中心结束 -->
	
	<!-- 右边黑框开始 -->
	<div id = "" class = "" style = "width:190px;height:1000px;background-color: #2e2e2e;margin: 2px;">
		
	</div>
	<!-- 右边黑框结束 -->
	
	
	

</div><!-- 总结束 -->


<script type="text/javascript">
$(function(){
	$("#left_order a").addClass("font_color")
})

//全选与全不选开始
function select_all(src){
	if($(src).is(":checked")){
		$("#sell_order_table input[type = 'checkbox']").prop('checked',true)
	}else{
		$("#sell_order_table input[type = 'checkbox']").prop('checked',false)
	}
}//全选与全不选开始

//发货开始
function fahuo(){
	var param = new Array()
	$(".sell_order_checkbox").each(function(){
		if($(this).is(":checked")){
			var id = $(this).attr("name")
			param.push(id)
		}
	})
	param = param.join(',')
	$.ajax({
        url:"${pageContext.request.contextPath}/FahuoServlet",
        async:false,
        type:"post",
        data:{"orderids":param},
        dataType:"json",
        success:function(d){
        	alert(d.msg+"条订单发货成功")
        	window.location.reload()
        }
    });
	
}//发货结束


</script>

<script type="text/javascript">

function asd(){
	if(confirm("确定删除吗？")){
		asdsad
	}
}
</script>


</body>
</html>